package cn.stylefeng.guns.modular.rest.order;

import cn.stylefeng.guns.modular.order.model.params.OrderWeightBoxParam;
import cn.stylefeng.guns.modular.order.model.result.OrderWeightBoxResult;
import cn.stylefeng.guns.modular.order.service.OrderWeightBoxService;
import cn.stylefeng.guns.modular.rest.aop.UserAop;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *地址控制器
 */
@Controller
@RequestMapping("/rest/orderBoxWeight")
public class RestOrderBoxWeightController extends BaseController {

    @Autowired
    private UserAop userAop;

    @Autowired
    private OrderWeightBoxService orderWeightBoxService;

    /**
     * 查询列表
     *
     * @author zhangzh
     * @Date 2024-05-20
     */
    @ResponseBody
    @RequestMapping("/findByBoxCode")
    public ResponseData findByBoxCode(OrderWeightBoxParam orderWeightBoxParam ) {
        OrderWeightBoxResult bySpec = this.orderWeightBoxService.findBySpec(orderWeightBoxParam);
        if(bySpec != null){
            return ResponseData.success(bySpec);
        }else{
            return ResponseData.error("未找到对应包材信息");
        }

    }
}
